Skip to main content

Multivariate Probability Distributions

Joint Probability Distribution

If X1,,XnX_1,\ldots, X_n are discrete random variables with P[X1=x1,X2=x2,,Xn=xn]=p(x1,,xn)P[X_1 = x_1, X_2 = x_2,\ldots, X_n = x_n] = p(x_1,\ldots, x_n), where x1,,xnx_1, \ldots, x_n are numbers, then the function pp is the joint probability mass function (p.m.f.) for the random variables X1,,XnX_1, \ldots, X_n.

For continuous random variables Y1,,YnY_1, \ldots, Y_n, a function ff is called the joint probability density function if P[YA]=f(y1,yn)dy1dy2dynP [Y\in {A}] =\displaystyle\in\displaystyle\int\ldots\displaystyle\int f(y_1,\ldots y_n)dy_1dy_2 \cdots dy_n.

Details

Definition

If X1,,XnX_1, \ldots, X_n are discrete random variables with P[X1=x1,X2=x2,,Xn=xn]=p(x1,,xn)P[X_1 = x_1, X_2 = x_2,\ldots, X_n = x_n] = p(x_1,\ldots, x_n) where x1xnx_1 \ldots x_n are numbers, then the function pp is the joint probability mass function (p.m.f.) for the random variables X1,,XnX_1, \ldots, X_n.

Definition

For continuous random variables Y1,,YnY_1, \ldots, Y_n, a function ff is called the joint probability density function if P[YA]=Af(y1,yn)dy1dy2dynP [Y\in {A}] = \underbrace{\displaystyle\int\displaystyle\int\ldots\displaystyle\int}_{A} f(y_1,\ldots y_n)dy_1dy_2 \cdots dy_n.

Note

Note that if X1,,XnX_1, \ldots, X_n are independent and identically distributed, each with p.m.f. pp, then p(x1,x2,,xn)=q(x1)q(x2)q(xn)p(x_1, x_2, \ldots, x_n) = q(x_1)q(x_2)\ldots q(x_n), i.e. P[X1=x1,X2=x2,,Xn=xn]=P[X1=x1]P[X2=x2]P[Xn=xn]P [X_1 = x_1, X_2 = x_2,\ldots, X_n= x_n] = P [X_1 = x_1] P[X_2 = x_2]\ldots P[X_n= x_n].

Note

Note also that if AA is a set of possible outcomes (ARn)(A \subseteq \mathbb{R}^n), then we have

P[XA]=(x1,,xn)Ap(x1,,xn)P[X \in {A}] = \displaystyle\sum_{(x_1,\ldots,x_n)\in A} p(x_1,\ldots, x_n)

Examples

Example

An urn contains blue and red marbles, which are either light or heavy. Let XX denote the color and YY the weight of a marble, chosen at random:

X YLHTotalB5611R729TT12820\begin{array}{c c c c} \hline \\ X \setminus Y & \text{L} & \text{H} & \text{Total} \\ B & 5 & 6 & 11 \\ R & 7 & 2 & 9 \\ TT & 12 & 8 & 20 \\ \hline \end{array}

We have P[X="b",Y="l"]=520P[X="'b"', Y ="l"'] = \displaystyle\frac{5}{20}. The joint p.m.f. is

XYLHTotalB5206201120R720220920Total12208201\begin{array}{c c c c} \hline \\ X \setminus Y & \text{L} & \text{H} & \text{Total} \\ \text{B} & \displaystyle\frac{5}{20} & \displaystyle\frac{6}{20} & \displaystyle\frac{11}{20} \\ \text{R} & \displaystyle\frac{7}{20} & \displaystyle\frac{2}{20} & \displaystyle\frac{9}{20} \\ \text{Total} & \displaystyle\frac{12}{20} & \displaystyle\frac{8}{20} & 1 \\ \hline \end{array}

The Random Sample

A set of random variables X1,,XnX_1, \ldots, X_n is a random sample if they are independent and identically distributed. A set of numbers x1,,xnx_1, \ldots, x_n are called a random sample if they can be viewed as an outcome of such random variables.

Fig. 32

Details

Samples from populations can be obtained in a number of ways. However, to draw valid conclusions about populations, the samples need to obtained randomly.

Definition

In random sampling, each item or element of the population has an equal and independent chance of being selected.

A set of random variables X1,,XnX_1, \ldots, X_n is a random sample if they are independent and identically distributed.

Definition

If a set of numbers x1xnx_1 \ldots x_n can be viewed as an outcome of random variables, these are called a random sample.

Examples

Example

If X1,,XnUnf(0,1)X_1, \ldots, X_n \sim Unf(0,1), independent and identically distributed, i.e. X1X_1 and XnX_n are independent and each have a uniform distribution between 0 and 1. Then they have a joint density which is the product of the densities of X1X_1 and XnX_n. Given the data in the above figure and if x1,x2Rx_1, x_2 \in \mathbb{R}

f(x1,x2)=f1(x1)f2(x2)={1if 0x1,x210elsewheref(x_1, x_2) = f_1(x_1) f_2(x_2) = \begin{cases} 1 & \text{if } 0 \leq x_1, x_2 \leq 1 \\ 0 & \text{elsewhere} \end{cases}
Example

Toss two dice independently, and let X1,X2X_1, X_2 denote the two (future) outcomes. Then

P[X1=x1,X2=x2]={136if 1x1,x260elsewhereP[X_1 = x_1, X_2 = x_2] = \begin{cases} \displaystyle\frac{1}{36} & \text{if } 1 \leq x_1, x_2 \leq 6 \\ 0 & \text{elsewhere} \end{cases}

is the joint p.m.f.

The Sum of Discrete Random Variables

Details

Suppose X and Y are discrete random values with a probability mass function p. Let Z=X+Y. Then

P(Z=z)={(x,y):x+y=z}p(x,y)\begin{aligned} P(Z=z) & = &\displaystyle\sum_{\{ (x,y): x+y=z\}} p(x,y)\end{aligned}

Examples

Example

(X,Y)=outcomes(X,Y) = \text{outcomes},

    [,1] [,2] [,3] [,4] [,5] [,6]
[1,] 2 3 4 5 6 7
[2,] 3 4 5 6 7 8
[3,] 4 5 6 7 8 9
[4,] 5 6 7 8 9 10
[5,] 6 7 8 9 10 11
[6,] 7 8 9 10 11 12

P[X+Y=7]=636=16P[X+Y =7] =\displaystyle\frac{6}{36}=\displaystyle\frac{1}{6}

Because there are a total of 3636 equally likely outcomes and 77 occurs six times this means that P[X+Y=7]=16P[X + Y = 7] =\displaystyle\frac{1}{6}.

Also

P[X+Y=4]=336=112P[X+Y = 4] = \displaystyle\frac{3}{36} = \displaystyle\frac{1}{12}

The Sum of Two Continuous Random Variables

If XX and YY are continuous random variables with joint p.d.f. ff and Z=X+YZ=X+Y, then we can find the density of ZZ by calculating the cumulative distribution function.

Fig. 33

Details

If XX and YY are c.r.v. with joint p.d.f. ff and Z=X+YZ=X+Y, then we can find the density of ZZ by first finding the cumulative distribution function

P[Zz]=P[X+Yz]{(x,y):x+yz}f(x,y)dxdyP[Z \leq z]=P[X+Y \leq z]\displaystyle\int\displaystyle\int_{\{(x,y):x+y \leq z\}} f(x,y)dxdy

Examples

Example

If X,YUnf(0,1)X,Y \sim Unf(0,1), independent and Z=X+YZ=X+Y then

P[Zz]={0for z0z22for 0<z<11for z>21(2z)22for 1<z<2P[Z \leq z] = \begin{cases} 0 & \text{for } z \leq 0 \\ \displaystyle\frac{z^2}{2} & \text{for } 0 < z < 1 \\ 1 & \text{for } z > 2 \\ 1-\displaystyle\frac{(2-z)^2}{2} & \text{for } 1 < z < 2 \end{cases}

the density of zz becomes

g(z)={zfor 0<z12zfor 1<z20for elsewhereg(z) = \begin{cases} z & \text{for } 0 < z \leq 1 \\ 2-z & \text{for } 1 < z \leq 2 \\ 0 & \text{for } \text{elsewhere} \end{cases}
Example

To approximate the distribution of Z=X+YZ=X+Y where X,YUnf(0,1)X,Y \sim Unf(0,1) independent and identically distributed, we can use Monte Carlo simulation. So, generate 10.000 pairs, set them up in a matrix and compute the sum.

Means and Variances of Linear Combinations of Independent Random Variables

If XX and YY are random variables and a,bRa,b\in\mathbb{R}, then

E[aX+bY]=aE[X]+bE[Y]E[aX+bY] = aE[X]+bE[Y]

Details

If XX and YY are random variables, then

E[X+Y]=E[X]+E[Y]E[X+Y] = E[X]+E[Y]

i.e. the expected value of the sum is just the sum of the expected values. The same applies to a finite sum, and more generally

E[i=1naiXi]=i=1naiE[Xi]E\left[\displaystyle\sum_{i=1}^{n} a_i X_i\right] = \displaystyle\sum_{i=1}^{n} a_i E[X_i]

when Xi,,XnX_i,\dots,X_n are random variables and a1,,ana_1,\dots,a_n are numbers (if the expectations exist).

If the random variables are independent, then the variance also add

Var[X+Y]=Var[X]+Var[Y]Var[X+Y] = Var[X] + Var[Y]

and

Var[i=1naiXi]=i=1nai2Var[Xi]Var\left[\displaystyle\sum_{i=1}^{n} a_i X_i\right] = \displaystyle\sum_{i=1}^{n} a_i^2 Var[X_i]

Examples

Example

X,YUnf(0,1)X,Y \sim Unf(0,1), independent and identically distributed, then

E[X+Y]=E[X]+E[Y]=01x1dx01x1dx=[12x2]01+[12x2]01=1E[X+Y]=E[X] + E[Y] =\displaystyle\int_0^1 x\cdot 1dx\displaystyle\int_0^1 x\cdot 1dx = \left[\displaystyle\frac{1}{2}x^2\right]_0^1+\left[\displaystyle\frac{1}{2}x^2\right]_0^1=1

Example

Let X,YN(0,1)X,Y\sim N(0,1). Then E[X2+Y2]=1+1=2E[X^2+Y^2] = 1+1=2.

Means and Variances of Linear Combinations of Measurements

If x1,,xnx_1,\dots,x_n and y1,,yny_1,\dots,y_n are numbers, and we set

zi=xi+yiz_i=x_i + y_i

wi=axiw_i=ax_i

where a>0a>0, then

z=1ni=1nzi=x+y\overline{z} = \displaystyle\frac{1}{n} \displaystyle\sum_{i=1}^{n} z_i= \overline{x} + \overline{y}

w=ax\overline{w}= a\overline{x}

sw2=1n1i=1n(wiw)2s_w^2=\displaystyle\frac{1}{n-1}\displaystyle\sum_{i=1}^{n}(w_i-\overline{w})^2

=1n1i=1n(axiax)2= \displaystyle\frac{1}{n-1}\displaystyle\sum_{i=1}^{n}(ax_i-a\overline{x})^2

=a2sx2= a^2s_x^2

and

sw=asxs_w=as_x

Examples

Example

We set:

a < -3
x <- c(1:5)
y <- c(6:10)

Then:

z <- x+y
w <- a*x
n <-length(x)

Then z\overline{z} is:

> (sum(x)+sum(y))/n
[1] 11

> mean(z)
[1] 11

and w\overline{w} becomes:

> a*mean(x)
[1] 9

> mean(w)
[1] 9

and sw2s_w^2 equals:

> sum((w-mean(w))^2))/(n-1)
[1] 22.5

> sum((a*x - a*mean(x))^2)/(n-1)
[1] 22.5

> a^2*var(x)
[1] 22.5

and sws_w equals:

> a*sd(x)
[1] 4.743416

> sd(w)
[1] 4.743416

The Joint Density of Independent Normal Random Variables

If Z1,Z2N(0,1)Z_1, Z_2 \sim N(0,1) are independent then they each have density

ϕ(x)=12πex22,xR\phi(x)=\displaystyle\frac{1}{\sqrt{2\pi}}e^{-\displaystyle\frac{x^2}{2}},x\in\mathbb{R}

and the joint density is the product f(z1,z2)=ϕ(z1)ϕ(z2)f(z_1,z_2)=\phi(z_1)\phi(z_2) or

f(z1,z2)=1(2π)2ez122z222f(z_1,z_2)=\displaystyle\frac{1}{(\sqrt{2\pi})^2} e^{\displaystyle\frac{-z_1^2}{2}-\displaystyle\frac{z_2^2}{2}}

Details

If XN(μ1,σ12)X\sim N (\mu_1,\sigma_1^2) and YN(μ2,σ22)Y\sim N(\mu_2, \sigma_2^2) are independent, then their densities are:

fX(x)=12πσ1e(xμ1)22σ12f_X (x) = \displaystyle\frac{1}{\sqrt{2\pi}\sigma_1} e^{\displaystyle\frac{-(x-\mu_1)^2}{2\sigma_1^2}}

and:

fY(y)=12πσ2e(yμ2)22σ22f_Y(y) = \displaystyle\frac{1}{\sqrt{2\pi}\sigma_2} e^{\displaystyle\frac{-(y-\mu_2)^2}{2\sigma_2^2}}

and the joint density becomes:

12πσ1σ2e(xμ1)22σ12(yμ2)22σ22\displaystyle\frac{1}{2\pi\sigma_1\sigma_2} e^{-\displaystyle\frac{(x-\mu_1)^2}{2\sigma_1^2}-\displaystyle\frac{(y-\mu_2)^2}{2\sigma_2^2}}

Now, suppose X1,,XnN(μ,σ2)X_1,\ldots,X_n\sim N(\mu,\sigma^2) are independent and identically distributed, then

f(x)=1(2π)n2σnei=1n(xiμ)2aσ2f(\underline{x})=\displaystyle\frac{1}{(2\pi)^{\displaystyle\frac{n}{2}}\sigma^n} e^{-\displaystyle\sum^{n}_{i=1} \displaystyle\frac{(x_i-\mu)^2}{a\sigma^2}}

is the multivariate normal density in the case of independent and identically distributed variables.

More General Multivariate Probability Density Functions

Examples

Example

Suppose XX and YY have the joint density

f(x,y)={2 0yx10 otherwisef(x,y) = \begin{cases} 2 & \text{ } 0\leq y \leq x \leq 1 \\ 0 & \text{ otherwise} \end{cases}

First notice that

RRf(x,y)dxdyx=01y=0x2dydx=012xdx=1\displaystyle\int_{\mathbb{R}}\displaystyle\int_{\mathbb{R}}f(x,y)dxdy\displaystyle\int_{x=0}^{1}\displaystyle\int_{y=0}^x2dydx = \displaystyle\int_0^12xdx = 1

so ff is indeed a density function.

Now, to find the density of XX, we first find the c.d.f. of XX First note that for a<0a<0 we have P[Xa]=0P[X\leq a]=0, but, if a0a\geq 0, we obtain

FX(a)=P[Xa]x0ay=0x2dydx=[x2]0a=a2F_X(a)=P[X\leq a]\displaystyle\int_{x_0}^a \displaystyle\int_{y=0}^x2dydx=[x^2]_0^a=a^2

The density of XX is therefore

fX(x)=dF(x)dx{2x 0x10 otherwisef_X(x) = \displaystyle\frac{dF(x)}{dx} \begin{cases} 2x & \text{ } 0\leq x \leq 1 \\ 0 & \text{ otherwise} \end{cases}

Handout

If f:RnRf: \mathbb{R}^n\rightarrow\mathbb{R} is such that P[XA]=Af(x1,,xn)dx1dxnP[X \in A] =\displaystyle\int_A\ldots\displaystyle\int f(x_1,\ldots, x_n)dx_1\cdots dx_n and f(x)0f(x)\geq 0 for all xRn\underline{x}\in \mathbb{R}^n, then ff is the joint density of

X=(X1Xn)\mathbf{X}= \left( \begin{array}{ccc} X_1 \\ \vdots \\ X_n \end{array} \right)

If we have the joint density of some multidimensional random variable X=(X1,,Xn)X=(X_1,\ldots,X_n) given in this manner, then we can find the individual density functions of the XiX_i 's by integrating the other variables.